| Changed DisEstablishSplineDependency so that it correctly breaks the dependency.
| Version 1.10, 12/31/95
| Updated for Igor Pro 3.0.
| However, these procedures will work only if the source waves are in the current data folder.
| Drag Spline
| These procedures are designed to help you put a smooth curve through
| a noisy data set with a large number of points.
| To use them:
| Choose Add Spline Controls’ from the Macros menu. This will add some controls to the top graph.
| Choose a data set from the Input Data popup menu.
| Click the Start Spline Drag button.
| Drag the spline nodes (black dots) around.
| Click Stop Spline Drag when you are done.
| See the example experiment "Drag Spline Demo" in the "Examples" folder for further details.
#pragma rtGlobals = 1
#include <Wave Lists>, menus=0
#include <Decimation>, menus=0
Menu "Macros"
"Add Spline Controls"
help = {"Adds some controls to the active graph. The controls make it easy to interactively put a smooth spline through a fairly large set of noisy data."}
End
| CheckDragSplineGlobals()
| Creates global settings used by other routines if they do not already exist.
| In most cases you will not need to tweak these globals.
Function CheckDragSplineGlobals()
NewDataFolder/O root:Packages
NewDataFolder/O root:Packages:'Drag Spline'
if (exists("root:Packages:'Drag Spline':gNumNodes") == 0)
Variable/G root:Packages:'Drag Spline':gNumNodes=20 | number of nodes through which spline is to be drawn
Variable/G root:Packages:'Drag Spline':gNumOutputPoints=200 | length of spline waves
endif
End
| SetSplineDragWaves(xDataWave, yDataWave)
| Sets the "Input Data" popup menu.
| The menu may contain one or two items.
| The first item is always "Choose Input Data".
| If the user has never chosen input data then there will be no second item.
| Otherwise, the second item will be something like:
| "data" if the input data is waveform data
| or
| "yData vs xData" if the input data is XY data
| All other routines determine the input data by interrogating this popup menu
| which acts as graph-local storage for the drag spline routines.
Function SetSplineDragWaves(xDataWave, yDataWave)
String xDataWave
String yDataWave
String s
Variable selectedItem
| Make sure that the names of the node and spline waves won't be too long
if ((strlen(xDataWave) > 27) %| (strlen(yDataWave) > 27))
Abort "Sorry, the input data wave names must not exceed 27 characters in length"
endif
s = "Choose Input Data...;"
if (strlen(yDataWave) == 0) | if yDataWave == "" then we are clearing data waves